﻿import {
    getCabins
} from "../../services/apiCabins.js";
import {useQuery} from "@tanstack/react-query";

export function useCabins(){
    const {
        isLoading,
        data:cabins,
        error,
    } = useQuery({
        queryKey:['cabins'],
        queryFn:getCabins
    });

    return {isLoading,error,cabins};
}